//
//  OptionCell.m
//  BOSS-SOOC
//
//  Created by apple on 16/8/24.
//  Copyright © 2016年 Gcx. All rights reserved.
//

#import "OptionCell.h"
#import "OptionModel.h"
#import "SizeLabel.h"
#import "UIView+WHC_AutoLayout.h"

@implementation OptionCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        _commentLabel   = [SizeLabel new];
        _timeLabel      = [UILabel new];
        _pingjieView    = [UIImageView new];
        _numLabel       = [UILabel new];
        
<<<<<<< HEAD
        
        _commentLabel   = [SizeLabel new];
        _timeLabel      = [UILabel new];
        _pingjieView    = [UIImageView new];
        _numLabel       = [UILabel new];
        
=======
>>>>>>> 1dcd124a62c1f4d5dff9fbf868fe64c33aa8265f
        _commentLabel.numberOfLines = 0;
        _timeLabel.textAlignment = NSTextAlignmentLeft;
        _pingjieView.image = [UIImage imageNamed:@"讨论icon"];
        _pingjieView.contentMode = UIViewContentModeScaleAspectFit;
        _numLabel.textAlignment = NSTextAlignmentLeft;

        _commentLabel.textColor=Color333333;
        _commentLabel.font=NormalFont(42);
        _timeLabel.textColor = Color999999;
        _timeLabel.font=NormalFont(33);
        _numLabel.textColor=Color999999;
        _numLabel.font=NormalFont(33);
        
        [self.contentView addSubview:_commentLabel];
        [self.contentView addSubview:_timeLabel];
        [self.contentView addSubview:_pingjieView];
        [self.contentView addSubview:_numLabel];

<<<<<<< HEAD
        
        _commentLabel.whc_LeftSpace(ScaleSize(42))
                    .whc_TopSpace(ScaleSize(60))
                    .whc_RightSpace(ScaleSize(42))
                    .whc_heightAuto();
        
        _timeLabel.whc_LeftSpace(ScaleSize(42))
                .whc_TopSpaceToView(ScaleSize(54),_commentLabel)
                .whc_Size(CGSizeMake(150, 20));
        
        _pingjieView.whc_LeftSpaceToView(55*Bili, _timeLabel)
                    .whc_TopSpaceToView(ScaleSize(54),_commentLabel)
                    .whc_Size(CGSizeMake(ScaleSize(42), ScaleSize(42)));
        
=======
        
        _commentLabel.whc_LeftSpace(ScaleSize(42))
                    .whc_TopSpace(ScaleSize(60))
                    .whc_RightSpace(ScaleSize(42))
                    .whc_heightAuto();
        
        _timeLabel.whc_LeftSpace(ScaleSize(42))
                .whc_TopSpaceToView(ScaleSize(54),_commentLabel)
                .whc_Size(CGSizeMake(150, 20));
        
        _pingjieView.whc_LeftSpaceToView(55*Bili, _timeLabel)
                    .whc_TopSpaceToView(ScaleSize(54),_commentLabel)
                    .whc_Size(CGSizeMake(ScaleSize(42), ScaleSize(42)));
        
>>>>>>> 1dcd124a62c1f4d5dff9fbf868fe64c33aa8265f
        _numLabel.whc_LeftSpaceToView(ScaleSize(24), _pingjieView)
                .whc_TopSpaceToView(ScaleSize(54),_commentLabel)
                .whc_Size(CGSizeMake(25, 20));
    }
    
    return self;
}

-(void)initWithModel:(OptionModel *)mol{
    
    _commentLabel.text=mol.ztnr;
    _numLabel.text=mol.replycount;
    _timeLabel.text=mol.input_time;

    
}

+(OptionCell *)cellWithTab:(UITableView *)tableView{
    
    static NSString *ident = @"IDD";
    OptionCell *cell = [tableView dequeueReusableCellWithIdentifier:ident];
    if (!cell) {
        
        cell = [[OptionCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ident];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    return cell;
}


@end
